<div>
    <form class="form-horizontal bv-form"  role="form"  id="updateForm">
        <input type="hidden" name="behavior_id" value="{$res.behavior_id}">
        <fieldset>
            <legend>基本信息</legend>
            <div class="form-group">
                <label class="col-sm-3 control-label">行为名称</label>
                <div class="col-sm-5">
                    <input type="text"  class="form-control" id="behavior_name" value="{$res.behavior_name}" name="behavior_name">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label yl">行为图标</label>
                <div class="col-sm-5">
                    <a href="javascript:;" class="file">选择文件
                        <input type="file" name="fileImg" id="file2" onchange="bbbb(this);">
                    </a>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">预览图片</label>
                <div class="col-sm-3 file1_1" id="androimg_file" style="float:left">
                    <img src="{$res.behavior_img}" height="150" width="150"/>

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label yl">城市行为图</label>
                <div class="col-sm-5">
                    <a href="javascript:;" class="file">选择文件
                        <input type="file" name="fileImg2" id="file3" onchange="cccc(this);">
                    </a>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">预览图片</label>
                <div class="col-sm-3 file1_1" id="androimg_file2" style="float:left">
                    <img src="{$res.behavior_pic}" height="150" width="150"/>

                </div>
            </div>

        </fieldset>
    </form>

</div>

<script type="text/javascript">
    function bbbb(file) {
        var prevDiv = document.getElementById('androimg_file');
        if (file.files && file.files[0]) {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '" height="150" width="150"/>';
            }
            reader.readAsDataURL(file.files[0]);
        } else {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }
    function cccc(file) {
        var prevDiv = document.getElementById('androimg_file2');
        if (file.files && file.files[0]) {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '" height="150" width="150"/>';
            }
            reader.readAsDataURL(file.files[0]);
        } else {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }

</script>




